home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / idl-faq < prev    next >
Encoding:
Text File  |  1995-07-25  |  35.2 KB  |  912 lines

  1. Subject: IDL (Interactive Data Language) FAQ
  2. Newsgroups: comp.lang.idl-pvwave,comp.answers,news.answers
  3. From: 8015@sbsun0010.sbrc.hac.com (Mike Schienle)
  4. Date: 24 Oct 1994 15:37:58 GMT
  5.  
  6.  
  7. Archive-name: idl-faq
  8. Last-modified: 9/19/94
  9. Version: 2.8
  10.  
  11. Changes since version 2.7:
  12. . Updated information regarding next release dates.
  13. . Changed reference to openwin3.doc to sun.doc.
  14.  
  15. Changes since version 2.6:
  16. . New question T19 added regarding MacX and IDL.
  17. . Updated information regarding current IDL versions.
  18. . Reference to current IDL version changed from 3.5.1 to 3.6.1.
  19.  
  20. Changes since version 2.5:
  21. . T18 responses corrected.
  22.  
  23. Changes since version 2.4:
  24. . New question T18 added regarding vectorizing an equation.
  25. . Address change for FAQ maintainer.
  26. . Address change for FAQ location.
  27.  
  28. Changes since version 2.3:
  29. . New question T17 added regarding cross-hair cursor.
  30. . Additional info for NASA ftp site.
  31. . Additional information provided for question T01 regarding contours.
  32. . Question G09 referred to the "other" IDL as Interface Description
  33.   Language, rather than the correct Interface Definition Language.
  34.  
  35. Changes since version 2.2:
  36. . Question G13 regarding IDL World Wide Web info added.
  37. . JHU/APL IDL library name changed from nansen to fermi. Nansen will
  38.   still work for some time.
  39. . Release dates for upcoming versions of IDL revised.
  40.  
  41. Changes since version 2.1:
  42. . Due to resource problems, the lumpi.informatik.uni-dortmund.de site
  43.   is no longer carrying IDL binaries. However, the distribution is now
  44.   available from ftp.Germany.EU.net (192.76.144.75).
  45. . Reference to current IDL version changed from 3.5 to 3.5.1.
  46. . Mention of compressed version of FAQ included.
  47. . Added ESRG to list of FTP sites.
  48.  
  49. This is a list of Frequently Asked Questions about the Interactive Data
  50. Language or IDL.  These questions pop up fairly regularly in the newsgroup
  51. comp.lang.idl-pvwave.  This list is an attempt to cut down on net.traffic
  52. regarding commonly asked questions.  Users are encouraged to read through
  53. this list before posting a query to the newsgroup.
  54.  
  55. As of 12/01/93 Mike Schienle has been maintaining the IDL FAQ. The
  56. previous IDL FAQ maintainer, Patrick Ryan, has moved on to other work.
  57. Many comments in this FAQ are Pat's, but I have no reason to change
  58. them. (MGS)
  59.  
  60.   A Note from the editor about PV~WAVE:
  61.  
  62.   I do not have any direct experience with PV~WAVE.  As such, I will try to
  63.   minimize comments which appear to favor one package or the other.  I
  64.   will, however, welcome concise descriptions of technical and functional
  65.   differences between the two packages.
  66.  
  67. If you are viewing this text in a GNU Emacs Buffer, you can type
  68. "M-2 C-x $" to get an overview of just the questions.  Then, when you want
  69. to look at the text of the answers, just type "C-x $".
  70.  
  71. This list is roughly divided into two categories: general questions and
  72. technical questions.  General question numbers are prefixed with a "G" and
  73. technical ones with a "T".
  74.  
  75.  
  76.   The following questions are answered:
  77.  
  78.   G01.    What is IDL?
  79.   G02.    Where can I contact them?
  80.   G03.    How do I get IDL?
  81.   G04.    What is the current version of IDL?
  82.   G05.    On what systems does IDL run?
  83.   G06.    What is PV~WAVE and how is it related to IDL?
  84.   G07.    Are there anonymous FTP sites for IDL?
  85.   G08.    How can I get help?
  86.   G09.    Why are there two newsgroups for IDL?
  87.   G10.    Does anyone at RSI read this group?  Is anyone there listening?
  88.   G11.    When is the next version of IDL due out?
  89.   G12.    Are there training courses available for IDL?
  90.   G13.  Is there a World Wide Web server for IDL or IDL based projects?
  91.   T01.    Why doesn't polycontour fill open contours?
  92.   T02.    How do I increase the number of commands stored in the
  93.   T03.    How do I get IDL to call routines in language X, running
  94.   T04.    Why does XPALETTE edit my color table incorrectly?
  95.   T05.    Is there on-line help for IDL?
  96.   T06.    I run IDL under X in SunOS 4.x, and after I logout, the screen
  97.   T07.    Sometimes my variables seem to disappear.  Why is this?
  98.   T08.    Is there a major mode for editing IDL code in Emacs?
  99.   T09.    How do I get 3-D widgets under OpenLook 3.0?
  100.   T10.    Why does one of the widgets appear red under OpenWindows?
  101.   T11.    Where are all the IDL routines and userlib procedures?
  102.   T12.    Does anybody know how to put multiple image plots on one page in
  103.   T13.    Does case matter in IDL?
  104.   T14.    How do I set up IDL to get precise control over plot window
  105.     and text positioning with either portrait or landscape page
  106.     orientation on a PostScript or HP-GL printer?
  107.   T15.    I get the error message "Code Area Full".  What do I do?
  108.   T16.    Sometimes I get the following error message:
  109.         % Unable to allocate memory: to make array.  not enough core
  110.   T17.    How can I set the cursor to a crosshair on my display?
  111.   T18.    How can I vectorize an equation of two different arrays?
  112.   T19.  How can I get IDL to work with MacX?
  113.  
  114.  
  115. ============================================================
  116. GENERAL:
  117.  
  118.  
  119. G01.    What is IDL?
  120.   
  121.     IDL is the Interactive Data Language.  It is a product of
  122.   Research Systems, Inc. (RSI).
  123.   
  124.   The following is quoted from the README file at rsinc.com:/pub/idl/README.
  125.   As such, it describes IDL's capabilities in an understandably subjective
  126.   manner.  ;-)
  127.   
  128.   {begin quote}
  129.       IDL, Interactive Data analysis Language, is a
  130.   complete package for the interactive reduction, analysis,
  131.   and visualization of scientific data and images.  Optimized
  132.   for the workstation environment, IDL integrates a responsive
  133.   array oriented language with numerous data analysis methods
  134.   and an extensive variety of two and three dimensional
  135.   displays into a powerful tool for researchers.
  136.   
  137.     IDL supports an extensive data import capability,
  138.   publication quality hard copy output, and user-defined Motif
  139.   graphical user interfaces.
  140.   
  141.     Users can create complex visualizations in hours
  142.   instead of weeks with the aid of IDL's high level capabilities
  143.   and interactive environment.
  144.   
  145.     IDL is useful in physics, astronomy, image and
  146.   signal processing, mapping, medical imaging, statistics,
  147.   and other technical disciplines requiring visualization of
  148.   large amounts of data.
  149.   {end quote}
  150.   
  151.   Here is a short history of RSI:
  152.       [attributed to ali@rsinc.com (Ali Bahrami)]
  153.   
  154.   {begin quote}
  155.   IDL is a product of Research Systems, Inc., founded in 1977 by David
  156.   Stern.  The origins of IDL were developed at the Laboratory for
  157.   Atmospheric and Space Physics (LASP) at the University of Colorado. David
  158.   was one of the people involved in efforts to make computers easier to use 
  159.   for the physicists at the Lab.  The first program in the evolutionary
  160.   chain to IDL was named Rufus (named after Dave's dog). Rufus was a very
  161.   simple vector oriented calculator that ran on the PDP-12. It accepted 2
  162.   letter codes that specified (1) An arithmetic operation (2) The input
  163.   registers to serve as operands, and (3) the destination register. The
  164.   next version was the Mars Mariner Spectrum Editor (MMED) which was a
  165.   version of Rufus that ran on the PDP-8.
  166.   
  167.   The next program in this line was named SOL, and it also ran on the
  168.   PDP-8.  Unlike its predecessors, SOL was a real computer language with a
  169.   real syntax (no more 2 letter codes). It was an APL influenced array
  170.   oriented language with some primitive graphics capabilities.  The
  171.   resemblance to IDL was there, but very faintly.
  172.   
  173.   In 1977, Dave left LASP to start Research Systems Inc. (RSI) with the
  174.   intention of building on the ideas contained in SOL. The initial result
  175.   of this endeavor was PDP-11 IDL, which was much more capable than SOL.
  176.   Graphics was usually done on Tektronix terminals and outboard raster
  177.   graphics displays. I used this version at LASP in 1981 on a PDP11/34 under 
  178.   RSX-11M in 1981 (I worked as a student at LASP from 1981 to 1987). I
  179.   didn't use it for very long though, because 1981 was the year that Dave
  180.   released the VAX/VMS version of IDL. This version, which was written in
  181.   VAX-11 MACRO and FORTRAN, took advantage of the VAX virtual memory and
  182.   32-bit address space, and was a huge step beyond the PDP-11 version. It
  183.   used essentially the same sort of graphics hardware as the PDP-11.
  184.   
  185.   In 1987, Dave decided that Unix workstations were the direction in which
  186.   IDL should progress, but porting the current VAX IDL to Unix didn't make
  187.   much sense because of its MACRO and FORTRAN implementation.  I had just
  188.   finished my Masters degree and was looking for work.  Dave hired me and
  189.   together we wrote the current version of IDL for Unix on the Sun 3 taking
  190.   advantage of the re-write to extend and improve the language. Since then,
  191.   we've ported it to many Unix machines and moved it back to VMS. RSI has
  192.   many other employees now, but our focus is still the continued
  193.   development of IDL. Recently, IDL was ported to PC class systems running
  194.   Microsoft Windows.
  195.   {end quote}
  196.   
  197.   
  198. G02.    Where can I contact them?
  199.   
  200.     Their address is:
  201.   
  202.     Research Systems, Inc.
  203.         2995 Wilderness Place
  204.     Boulder, CO 80301
  205.     (303) 786-9900      (Voice)
  206.     (303) 786-9909      (Fax)
  207.   
  208.     Email:
  209.         info@rsinc.com or support@rsinc.com         # Internet
  210.         ORION::IDL                                  # SPAN
  211.   
  212.   
  213. G03.    How do I get IDL?
  214.   
  215.     RSI's distribution scheme is unique in that all of the binaries and
  216.   IDL code needed are available via anonymous ftp.  IDL binaries and code
  217.   are available at these sites: 
  218.   
  219.     gateway.rsinc.com (192.5.156.17)
  220.         pub/idl
  221.     boulder.colorado.edu (128.138.240.1)
  222.         pub/idl
  223.     ftp.Germany.EU.net (192.76.144.75)
  224.         shop/CreaSo/IDL
  225.   
  226.   The README file describes which files are needed, how to unpack them, and
  227.   how to install them. 
  228.     If you install IDL without a valid license, you will get IDL's 7
  229.   minute demo mode.  This mode is designed for users who are considering
  230.   buying the package. 
  231.     To actually get IDL running for good, you must pay for a license
  232.   from RSI and follow their instructions.  You will be asked to fill out a
  233.   form with information unique to your machine.  RSI will create a license
  234.   key which the license manager program (lmgrd) reads to validate your
  235.   license.
  236.     As of release 3.1, upgrades to IDL are no longer free.  For details
  237.   about upgrades and support contracts, contact RSI.
  238.   
  239.   
  240. G04.    What is the current version of IDL?
  241.   
  242.     IDL 3.6.1 is the current version.  It was released in August, 1994.
  243.     
  244. G05.    On what systems does IDL run?
  245.   
  246.     The information below is from the file RELEASE_LEVEL located at
  247.   rsinc.com:/pub/idl/RELEASE_LEVEL.  This information applies to release
  248.   3.6.1. It is also in the distribution set in $IDL_DIR/notes/currel.doc.
  249.   
  250.   {begin quote}
  251. This release supports the following systems:
  252.  
  253.     - Data General Aviion: DG/UX 5.4.1.
  254.     - DEC ALPHA: OSF1 2.0.
  255.     - DOS based personal computers running Microsoft Windows 3.1.
  256.     - Windows NT (Intel x86).
  257.     - HP 9000 Series 700: HP-UX 9.01.
  258.     - IBM 6000: AIX 3.2.5
  259.     - Apple Macintosh (Motorola 68k) computers running System 7
  260.     - Risc Ultrix: Ultrix 4.2.
  261.     - SGI: IRIX 5.2
  262.     - Sun 4 (sparc): SunOS 4.1.3.
  263.     - Sun 4 (sparc): Solaris 2.3 (SunOS 5.3).
  264.     - VMS:
  265.           [ALPHA] OpenVMS AXP 1.5.
  266.           [VAX] VMS 5.1 and up. Standard X windows graphics are
  267.         supported at all VMS versions. IDLwidgets are supported
  268.             at VMS 5.4-3 at up *if* the host system has version 1.1 
  269.         of the DECWINDOWS-MOTIF package installed.
  270.  
  271. The following hardware/operating system combinations are no longer
  272. supported. The last release of these versions have been archived, and no
  273. future development for them will be done:
  274.  
  275.     - Sun 386i (last release: 2.0.4).
  276.     - HP 9000 series 300 and 400 (last release: 3.1.0)
  277.     - VAX Ultrix (last release: 2.2.2)
  278.     - Sun 3 (last release: 3.1.0)
  279.     - MIPS running Risc/OS 4.52B (last release: 3.1.0)
  280.  
  281.   {end quote}
  282.   
  283. G06.    What is PV~WAVE and how is it related to IDL?
  284.   
  285.     Around the time that the Unix version of IDL first became available
  286.   (1988), Precision  Visuals Inc. (PVI) entered into an agreement with RSI
  287.   under which they enhanced and resold IDL under the name PV~WAVE. In
  288.   September of 1990, they exercised an option in that agreement that
  289.   resulted in the following:
  290.   
  291.     - They received a copy of the IDL source code as it existed in
  292.   September 1990 in return for a one-time payment to RSI.
  293.   
  294.     - The connection between RSI and PVI was severed.
  295.   
  296.     IDL and PV~WAVE are now on separate development tracks. Each
  297.   company enhances, supports, and maintains its own product.
  298.   
  299.     PVI has since merged with IMSL and is now Visual Numerics, Inc.
  300.   (VNI).
  301.   
  302.   
  303. G07.    Are there anonymous FTP sites for IDL?
  304.   
  305.   The sites below contain public domain IDL code.
  306.   
  307.     JHU/APL IDL library
  308.     fermi.jhuapl.edu [128.244.147.18]
  309.         /pub/idl
  310.   
  311.     NASA IDL Astronomy User's Library
  312.     (VAX) uit.gsfc.nasa.gov [128.183.57.27]
  313.     Username: idluser
  314.     Password: (Contact landsman@stars.gsfc.nasa.gov for password)
  315.     (Unix) idlastro.gsfc.nasa.gov [128.183.57.82]
  316.         /
  317.   
  318.     IUE RDAF library
  319.     iuesn1.gsfc.nasa.gov [128.183.57.16]
  320.     cetus.colorado.edu [128.138.238.151]
  321.         /pub
  322.   
  323.     ICUR Spectral Analysis Software
  324.     ftp.astro.psu.edu [128.118.147.28]
  325.         /pub/nefftp/icur
  326.   
  327.     IDL ROSAT software
  328.     legacy.gsfc.nasa.gov  [128.183.8.233]
  329.     rosat/software/idl
  330.  
  331.     IDLmeteo library
  332.     ftp.sma.ch (141.249.3.33)
  333.         /pub/idlmeteo
  334.  
  335.     ESRG library
  336.     eos.crseo.ucsb.edu [128.111.228.1]
  337.         /pub/idl
  338.   
  339. G08.    How can I get help?
  340.   
  341.     RSI has excellent telephone and email support.  You can contact
  342.   them at: 
  343.  
  344.     Voice:  (303) 786-9900
  345.     Fax:    (303) 786-9909
  346.   
  347.         Email:
  348.         (Internet)
  349.         info@rsinc.com        # general questions
  350.         support@rsinc.com    # technical support
  351.   
  352.         (SPAN)
  353.         ORION::IDL
  354.   
  355.   Keep in mind, however, that RSI's technical support is for their paying
  356.   customers, i.e. those with current support contracts.
  357.   
  358.   
  359. G09.    Why are there two newsgroups for IDL?
  360.   
  361.     Unfortunately, there are two very different packages with the
  362.   abbreviation "IDL".  The newsgroup comp.lang.idl is for the Interface
  363.   Definition Language.  The newsgroup for discussing issues related to
  364.   RSI's IDL and VNI's PV~WAVE and IMSL/IDL is comp.lang.idl-pvwave.
  365.   
  366.   
  367. G10.    Does anyone at RSI read this group?  Is anyone there listening?
  368.   
  369.     [ This question was included at the request of RSI.  The answer was
  370.       provided by Ali Bahrami.  -pat ]
  371.   
  372.     {begin quote}
  373.     Yes, many of us do. We're naturally curious what people think of
  374.     our product. We make notes about what people like and dislike and
  375.     this influences our decisions.
  376.   
  377.         However, you usually won't get a direct response from us from
  378.         a posting to this group. There are many reasons for this.
  379.         Here are a couple of the more important ones:
  380.   
  381.           [] We believe that this group should belong solely to the
  382.              user community, and should be free of vendor bias and
  383.              marketing. It should be noted that both RSI and Visual
  384.              Numerics (formerly PVI) have shown great restraint in this
  385.              matter, and that this group is largely left to the actual
  386.              users. (Long term readers will recall some notable exceptions
  387.              to this, but in general it is true.)
  388.   
  389.              It could be argued that as long as the topic stays
  390.              technical, vendor postings are OK. The problem with this
  391.              is that one persons technical posting is another's
  392.              blatant product plug, and the line between them is not
  393.              always obvious.
  394.   
  395.            [] We provide support for our customers via the phone and email.
  396.              If you would like an answer from us, you should
  397.              call us directly. We have no objection to you sharing the
  398.              information you get in this manner with the newsgroup as
  399.              long as you quote us accurately and separate fact from
  400.              conjecture.
  401.   
  402.         In other words, you should view this newsgroup as a way to share
  403.         questions and information with other users, not as a way to
  404.         contact the vendor.
  405.     {end quote}
  406.   
  407. G11.    When is the next version of IDL due out?
  408.   
  409.     IDL 3.6.1 was released in August, 1994.
  410.     IDL 3.7 is scheduled for release in the first half of 1995.
  411.     IDL 4.0 is scheduled for release in the second half of 1995.
  412.  
  413. G12.    Are there training courses available for IDL?
  414.   
  415.   [ This question included at the request of RSI. ]
  416.   
  417.   {begin quote}
  418.       RSI offers a number of IDL training courses for beginning,
  419.   intermediate, and advanced IDL users. IDL courses are scheduled monthly
  420.   at RSI's training facility in Boulder.  On-site IDL courses are also
  421.   available. Contact RSI at 303-786-9900 x 328 or at training@rsinc.com for
  422.   complete scheduling and price information.
  423.   {end quote}
  424.   
  425. G13.    Is there a World Wide Web server for IDL or IDL based projects?
  426.  
  427.   RSI has WWW pages on IDL in general:
  428.     http://sslab.colorado.edu:2222/projects/IDL/idl_ssl_home.html
  429.  
  430.   Hal Mueller at Texas A&M put together a Digital U.S. Map browser
  431.   based on images created by Ray Sterner at Johns Hopkins University
  432.   using IDL:
  433.     http://ageninfo.tamu.edu/apl-us/
  434.  
  435.   E. Loren Buhle, Jr. Ph.D. made a page on AVS IN MEDICAL TREATMENT
  436.   PLANNING which also discusses IDL:
  437.     http://archive.xrt.upenn.edu/0h/buhle/manuscripts/avs94_paper.html
  438.  
  439.   
  440. ============================================================
  441. TECHNICAL QUESTIONS:
  442.   
  443. Note for Sun users:
  444.   
  445. There is a mini FAQ for Sun IDL in $IDL_DIR/notes, and the following
  446. questions are answered in the file sun.doc:
  447. (1) IDL complains about missing fonts when creating widgets.
  448. (2) IDL complains about missing bitmap files when creating widgets.
  449. (3) How to make IDL work with OpenWindows version 3.0.
  450. (4) 3-D appearance for OpenLook IDLwidgets.
  451. (5) Why does one of the widgets appear red?
  452. (6) Why does pressing the left button while pointing at a pulldown menu
  453. button cause the menu to pop up with the pushpin in?  Older versions of IDL
  454. didn't to that.
  455. (7) The font used by the list widget is much larger than it used to be, and
  456. I don't like the result on my program.
  457. (8) Why do I get "Cannot allocate colormap entry" errors, and why do they
  458. kill IDL?
  459. (9) I've changed my .Xdefaults file, but nothing different happened. Why?
  460.   
  461.   
  462. T01.    Why doesn't polycontour fill open contours?
  463.   
  464.     This problem is described in the POLYCONTOUR manual page.
  465.   
  466.   {begin quote}
  467.   RESTRICTIONS:
  468.     This routine will NOT draw open contours.  To eliminate open
  469.     contours in your dataset, surround the original array with a 1-element
  470.     border on all sides.  The border should be set to a value less than
  471.     or equal to the minimum data array value.
  472.   
  473.     For example, if A is an (N,M) array enter:
  474.   
  475.         B = REPLICATE(MIN(A), N+2, M+2)    ;Make background
  476.         B(1,1) = A            ;Insert original data
  477.         CONTOUR, B, PATH=Filename ...    ;Create the contour file.
  478.   {end quote}
  479.   
  480.   [ This problem was fixed in IDL 3.1. ]  
  481.  
  482.   The following is from Ray Sterner at Johns Hopkins University:
  483.   Here is a very simple algorithm that might be a useful addition
  484.   to the section of the FAQ on filled contours.  It is for evenly
  485.   spaced contours only.
  486.  
  487.     Z  is an array to be contoured,
  488.     CI is the desired contour interval,
  489.     C0 is the desired starting color index,
  490.     D  is the desired step between colors.
  491.  
  492.     T = fix(Z/CI)
  493.     M = T - smooth(T,3)
  494.     F = (C0 + T*D)*(1-M)
  495.       is an array with filled contours with the contours
  496.       plotted with color 0.  For contours of a different color simply add
  497.       M*CC where CC is the desired contour color index.
  498.  
  499.   
  500. T02.    How do I increase the number of commands stored in the
  501. history buffer?
  502.   
  503.     The system variable !EDIT_INPUT controls command recall.  By
  504.   default, it is set to 1, causing the last 20 commands to be saved.  If it
  505.   is 0, no commands are saved.  To save more than 20 commands, just put
  506.   !EDIT_INPUT=50 (or other large number) in your startup file. 
  507.   
  508.     It is important to realize that IDL looks at the value of
  509.   !EDIT_INPUT the first time it reads anything from the keyboard, and the
  510.   size of the history buffer is fixed after that. Hence, the command must
  511.   be in a startup file because entering it at the keyboard is too late.
  512.   
  513.   
  514. T03.    How do I get IDL to call routines in language X, running
  515. under system Y?
  516.   
  517.     Jeff Valenti has written a sizable document about calling external
  518.   FORTRAN routines from IDL.  You can find it at
  519.   eos.crseo.ucsb.edu:/pub/idl/idl-fortran.
  520.   
  521.   
  522. T04.    Why does XPALETTE edit my color table incorrectly?
  523.   
  524.     Here is the answer from RSI support:
  525.   
  526.   {begin quote}
  527.   The color applications such as xpalette and xloadct use a common block
  528.   called "colors" to keep track of the color vectors.  When you call tvlct,
  529.   your vectors are loaded into the colormap, but they are not put into the
  530.   colors common block. 
  531.   
  532.   When xpalette starts, it checks to see if the colors have been defined in
  533.   the common block and uses them if they have.  Otherwise it sets them to
  534.   the standard black and white colormap, in which r,g,b are each linear
  535.   ramps. (The colors are as you expect because there is only one colormap.)
  536.   
  537.   Admittedly, this is not the most desirable situation.  You would like
  538.   your colors which you loaded with TVLCT to be recognized by xpalette.  We
  539.   modified xpalette (and xloadct) to use the current colormap when they
  540.   start up by getting the current vectors with TVLCT. 
  541.   
  542.   Another alternative would be to use the following lines to define the
  543.   common block prior to calling your current version of xpalette. 
  544.   
  545.   [ assume here that you have a routine called "restore" which reads colors
  546.     from a file somewhere and creates vectors r, g, and b.  -pat ]
  547.   
  548.   IDL> restore, file='ryan.sav', r, g, b   ;get the vectors from somewhere
  549.   IDL> tvlct, r, g, b
  550.   IDL> common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
  551.   IDL> r_orig = r & r_curr = r
  552.   IDL> g_orig = g & g_curr = g
  553.   IDL> b_orig = b & b_curr = b
  554.   IDL> xpalette
  555.   
  556.   {end quote}
  557.   
  558. T05.    Is there on-line help for IDL?
  559.   
  560.     Try ?.
  561.   
  562. T06.    I run IDL under X in SunOS 4.x, and after I logout, the screen
  563. becomes completely blank.  Typing in login names and passwords 'blindly'
  564. logs you in again with the 'correct' colors.  How to prevent this?
  565.   
  566.   [Note: This is only a problem under OpenWindows2. -pat ]
  567.   
  568.     Add the following to your .Xdefaults:
  569.   
  570.   Idl*colors:    -5
  571.   
  572.   which reserves some colors for the colormap so that IDL does not exhaust
  573.   all the available colors.  (For a nice summary of Sun IDL interactions
  574.   with OpenWindows, see $IDL_DIR/notes/sun.doc)
  575.   
  576.     Another solution is to put a call to clear_colormap in your .login
  577.   file to be executed after OpenWindows start up.
  578.   
  579.   
  580. T07.    Sometimes my variables seem to disappear.  Why is this?
  581.   
  582.   Quoting the IDL User's Guide, page 10-8:
  583.   
  584.   {begin quote}
  585.   IDL users may find that all their variables have seemingly disappeared
  586.   after an error occurs inside a procedure or function.  The misunderstood
  587.   subtlety is that after the error occurs, IDL's context is inside the called
  588.   procedure, not in the main level.  Typing RETALL or RETURN will make the
  589.   lost variables reappear.
  590.   
  591.   RETALL is best suited for use when an error is detected in a procedure and
  592.   it is desired to return immediately to the main program level despite
  593.   nested procedure calls.  RETALL issues RETURN commands until the main
  594.   program level is reached.
  595.   
  596.   The HELP command can be used to see the current call stack (i.e., which
  597.   program unit IDL is in and which program unit called it).
  598.   {end quote}
  599.   
  600.   
  601. T08.    Is there a major mode for editing IDL code in Emacs?
  602.   
  603.     Yes.
  604.     Chris Chase (chase@jackson.jhuapl.edu) has written idl.el for
  605.   editing IDL code.  He has also written idl-shell.el for running IDL as an
  606.   inferior process under emacs.  These can be found at:
  607.   
  608.     eos.crseo.ucsb.edu:pub/idl/idl.el
  609.     eos.crseo.ucsb.edu:pub/idl/idl-shell.el
  610.   
  611.     Lubos Pochman (lubosp@pvi.com) of VNI has developed a PV~WAVE major
  612.   mode.  Given the (remaining) strong similarity between PV~WAVE and IDL,
  613.   it has many of the features that one would like in such a mode.
  614.       It is available via anonymous ftp at these sites:
  615.   
  616.     ftp.pvi.com:/PVI/emacs/
  617.     eos.crseo.ucsb.edu:pub/idl/wave-mode.shar
  618.   
  619.   
  620. T09.    How do I get 3-D widgets under OpenLook 3.0?
  621.   
  622.    This subject is discussed on page 53 of the OpenWindows Version 3
  623.    User's Guide Release Manual.
  624.   
  625.    OpenWindows 3.0 added 3-D appearance for widgets. In order for
  626.    the 3-D look to work, it must be enabled and the background color
  627.    must be a medium tone color such as "grey" or "wheat".
  628.    Add the following resources to your ~/.Xdefaults file:
  629.   
  630.     For plain IDL:
  631.   
  632.         Idl*threeD:     TRUE
  633.         Idl*background: PeachPuff2
  634.   
  635.     For IMSL/IDL:
  636.         Imslidl*threeD:     TRUE
  637.         Imslidl*background: PeachPuff2
  638.   
  639. T10.    Why does one of the widgets appear red under OpenWindows?
  640.   
  641.    This subject is discussed on page 53 of the OpenWindows Version 3
  642.    User's Guide Release Manual.
  643.   
  644.    The OLIT widget toolkit, which is used by IDL, added the
  645.    concept of "mouseless focus" under version 3.0. The red widget
  646.    indicates where the current mouseless focus is. Use the arrow keys
  647.    to traverse the widgets, and the spacebar to make a selection.
  648.   
  649. T11.    Where are all the IDL routines and userlib procedures?
  650.   
  651.   The basic routines are not accessible, for obvious reasons.  The userlib,
  652.   statlib and widget procedures are in $IDL_DIR/lib/.  The procedure XDL also
  653.   displays the full pathname.  The system variable !path also contains the
  654.   directory names for all accessible IDL procedures.
  655.   
  656. T12.    Does anybody know how to put multiple image plots on one page in
  657. PostScript?
  658.   
  659.   Because PostScript has scalable pixels, you must specify the xsize and
  660.   ysize parameters, as well as the position parameter, in TV or TVSCL.
  661.   I don't know about PV-Wave, but the following works in IDL:
  662.   
  663.   ; Display four images in a 2x2 grid
  664.   ; Assume data(x,y,4) = array containing the 4 images
  665.   
  666.   set_plot, 'ps'           ;request PostScript output
  667.   device, ...              ;modify page size, orientation, etc. as desired
  668.   ximsize = 0.5*!d.x_size  ;define output image size
  669.   yimsize = 0.5*!d.y_size  ;note: 0.5 assumes 2x2 grid
  670.   for i=0,3 do begin       ;display the 4 images, using i as position index
  671.      tv, data(*,*,i), i, xsize=ximsize, ysize=yimsize
  672.   endfor
  673.   
  674. T13.    Does case matter in IDL?
  675.   
  676.       No.
  677.       Compiled routines are case insensitive.  The only catch is that, on
  678.   Unix systems, when executing a script via the .RUN command, the file name
  679.   argument must exactly match the file name as it appears on the disk.
  680.   Once the routines in the script are compiled, their names can be written
  681.   in any case.  This is not a problem in operating systems such as VMS that
  682.   do not distinguish case for file names.  This is usually not a problem
  683.   under Unix either since, by convention, most people use lower case file
  684.   names.
  685.   
  686.   
  687. T14.    How do I set up IDL to get precise control over plot window
  688. and text positioning with either portrait or landscape page orientation
  689. on a PostScript or HP-GL printer?
  690.   
  691.   
  692.   (This answer only applies to PostScript and HP-GL printers --
  693.   other printers may differ in having the X and Y offsets measured from
  694.   the upper left corner of the portrait page instead of the lower left
  695.   corner.)
  696.   
  697.   IDL uses portrait page orientation as a default.  (The x axis is along
  698.   the shorter dimension of the paper.)  In portrait orientation the lower
  699.   left corner of the page is the origin for the XOFFSET and YOFFSET page
  700.   offsetting keywords of the DEVICE command that determine the origin
  701.   (lower left corner) of the output window.  (Normally one uses XOFFSET=0
  702.   and YOFFSET=0 for portrait orientation.)  Size of the output window is
  703.   determined by the XSIZE and YSIZE keywords of the DEVICE command.
  704.   The origin for graph positioning variables !P.POSITION and !P.REGION
  705.   is the output window origin.  X and Y coordinates for portrait page
  706.   orientation are shown on the sketch below as upper case X and Y.
  707.   
  708.   
  709.                 ----------
  710.                 |        |   ORIGINAL PORTRAIT PAGE  (Printer only prints on
  711.               Y |        |         OUTPUT WINDOW                  this area.)
  712.                 |        |
  713.                 |   X    |
  714.                 o-----------
  715.                 |    y   + |   OUTPUT WINDOW ROTATED ABOUT LOWER LEFT CORNER
  716.               x |        + |
  717.                 |        + |
  718.                 ------------
  719.                 ++++++++++    OUTPUT WINDOW RESIZED FOR LANDSCAPE ORIENTATION
  720.                      ^
  721.                      |    DIRECTION OF NEEDED OFFSET
  722.   
  723.   
  724.   If device,/landscape is specified, then the output window is rotated
  725.   90 deg. clockwise about the lower left corner of the page.
  726.   In this condition nothing will be plotted on the page, since the
  727.   rotation has carried the output window entirely off the paper as shown
  728.   in the sketch above.  To correct this mismatch, the rotated output window
  729.   must be offset.  XOFFSET AND YOFFSET are still measured in the X and Y
  730.   coordinates of the portrait page, but now represent the position of the
  731.   lower left corner of the rotated (and resized) output window (marked by
  732.   an o above) with respect to the lower left corner of the portrait (actual)
  733.   page.  Hence, one generally uses XOFFSET=0 and
  734.   YOFFSET=long_dimension_of_page for landscape orientation.
  735.   
  736.   In landscape orientation, the coordinates for graph positioning variables
  737.   !P.POSITION and !P.REGION are the lower case x and y coordinates
  738.   shown in the sketch above and having origin marked by the letter o.
  739.   Position of output window origin o on the page is, of course, affected
  740.   by the setting of XOFFSET and YOFFSET, as explained before.  The XSIZE
  741.   and YSIZE (output window size) keywords of the DEVICE command are also
  742.   measured in the x and y directions when in landscape orientation.  The
  743.   resizing of the landscape page generally means interchanging the values
  744.   of XSIZE and YSIZE appropriate for the portrait page.
  745.   
  746.   
  747.   Example of settings for a portrait page:
  748.   
  749.   XPAGE=8.5  &  YPAGE=11.  &  XOFFS=0.  &  YOFFS=0.  ;Inches
  750.   DEVICE,/INCHES,XSIZE=XPAGE,YSIZE=YPAGE,XOFFSET=XOFFS,YOFFSET=YOFFS
  751.   
  752.   Example of settings for a landscape page:
  753.   
  754.   XPAGE=11.  &  YPAGE=8.5  &  XOFFS=0.  &  YOFFS=XPAGE  ;Inches
  755.   DEVICE,/LANDSCAPE,/INCHES,XSIZE=XPAGE,YSIZE=YPAGE,XOFFSET=XOFFS, $
  756.        YOFFSET=YOFFS
  757.   
  758.   Example of setting position and size of a plot window:
  759.   
  760.   X0=1.374  &  Y0=1.283  &  XLEN=3.622  &  YLEN=6.157  ;Inches
  761.   !P.POSITION=[X0/XPAGE,Y0/YPAGE,(X0+XLEN)/XPAGE,(Y0+YLEN)/YPAGE]
  762.   
  763.   Example of setting position and orientation of a text string:
  764.   
  765.   x0=.35  &  y0=.37  ;Inches
  766.   xyouts,x0/xpage,y0/ypage,!stime,orient=90,/normal     ;Date, time
  767.   
  768.   
  769. T15.     I get the error message "Code Area Full".  What do I do?
  770.   
  771.   IDL sets aside a certain amount of memory area for compiling programs.  The
  772.   current code and area sizes can be seen with the HELP command, e.g.
  773.   
  774.         IDL> help
  775.         % At $MAIN$  .
  776.         Code area used: 0% (0/16384),  Symbol area used: 0% (2/4096)
  777.   
  778.   These sizes can be increased with the .SIZE command.  Quoting the IDL User's
  779.   Manual, page 2-11:
  780.   
  781.   {begin quote}
  782.   These sizes represent a compromise between an unlimited program space and
  783.   conservation of memory.  User procedures and functions are compiled in this
  784.   large program area.  After successful compilation, a new memory are of the
  785.   required size is allocated to contain the newly compiled program unit.
  786.   
  787.   Resizing the code and data areas erases the currently compiled main program
  788.   and all mail program variables.  For example, to extend the code and data
  789.   areas to 30000 and 5000 bytes respectively:
  790.   
  791.                         .SIZE 30000 5000
  792.   {end quote}
  793.   
  794.   Getting "Code Area Full" is often an indication that the routine is
  795.   large, and would benefit by decomposition into sub-procedures/functions.
  796.   It's better to avoid use of .SIZE because your code will always work on
  797.   other systems where the users don't use a large .SIZE setting.
  798.   
  799.   
  800. T16.    Sometimes I get the following error message:
  801.  
  802. % Unable to allocate memory: to make array.
  803.  not enough core
  804.   
  805.   RSI support replies:
  806.   
  807.   {begin quote}
  808.   The circumstances described happen when memory becomes fragmented.
  809.   Unfortunately, there is nothing you can do except use less memory in your
  810.   application, or get more for the system to work with. 
  811.   {end quote}
  812.   
  813. T17.    How can I set the cursor to a crosshair on my display?
  814.  
  815.   Ray Sterner of Johns Hopkins University has written a procedure for
  816.   managing this called movcross. It is in the usr.tar file of the
  817.   JHU/APL IDL library mentioned in question G07.
  818.  
  819.   Joel Parker has written a procedure called rdplot which manages this
  820.   using an XOR graphics function and provides additional
  821.   functionality.  It is located in the NASA IDL Astronomy User's
  822.   Library mentioned in question G07.
  823.  
  824. T18.     How can I vectorize an equation of two different arrays?
  825.  
  826.   From the user community:
  827.     I have two different arrays, (8) of float and (300,8) of float.
  828.     I want to vectorize the equation and therefore I need to use both
  829.     arrays in the same equation. For example :
  830.  
  831.     newarray=cos(small_array)*sin(large_array)
  832.  
  833.     where I want the data in small_array to be used over and over 300
  834.     times in this calculation.
  835.  
  836.   From Dan Carr (dan@rsinc.com):
  837.     IDL> arr1 = Findgen(8)
  838.     IDL> arr2 = Findgen(300, 8)
  839.     IDL> newarr = (Replicate(1.0, 300) # Cos(arr1)) * Sin(arr2)
  840.  
  841.   From Dave Landers (landers@tsunami.dseg.ti.com)
  842.     to convert an array1(M) to array2(n,M) :
  843.         array2 = array1( Lindgen(n,M) / n )
  844.     or  array2 = replicate(1,n) # array1
  845.  
  846.     to convert an array1(M) to array2(M,n) :
  847.         array2 = array1( Lindgen(M,n) MOD M )
  848.     or  array2 = array1 # replicate(1,n)
  849.  
  850. T19.     How can I get IDL and MacX to work without crashing?
  851.  
  852.   Using MacX v1.2 and IDL cause the Mac to crash quite often. This
  853.   happens especially during allocation of color resources or display
  854.   windows. You can get around the problem by downgrading to MacX v1.1.7
  855.   (apparently Apple will supply this if you can prove to them that you
  856.   rightfully own v1.2).  Another solution is to purchase White Pine's
  857.   eXodus software. Rumors are that eXodus is an overall better product
  858.   than MacX. White Pine can be contacted at:
  859.  
  860.   White Pine Software
  861.   40 Simon St. Suite 201 Nashua, NH 03060-3043
  862.   phone: 603-886-9050 Fax: 603-886-9051
  863.  
  864.  
  865. ============================================================
  866.   
  867.   Disclaimer:
  868.   
  869.   I do not work for RSI and I am in no way answerable to them.  Questions and
  870.   answers in this document are culled from the user community.  No warranty,
  871.   express or implied exists regarding this document.  Permission to copy all
  872.   or part of this work is granted, provided that the copies are not made or
  873.   distributed for resale.
  874.   
  875. This file can always be found at eos.crseo.ucsb.edu [128.111.228.1] in
  876. pub/idl/idl-faq. A compressed version is also stored in this location.
  877. A URL entry for this file would look like:
  878.  
  879. file://eos.crseo.ucsb.edu/pub/idl/idl-faq
  880. file://eos.crseo.ucsb.edu/pub/idl/idl-faq.Z
  881.   
  882.   Additions and corrections should be sent to:
  883.   
  884.       mgs@sbsun0010.sbrc.hac.com
  885.   
  886.   -----
  887.     Many thanks to the following for their contributions.
  888.   
  889.     black@breeze.rsre.mod.uk (John Black)
  890.     claflin@claes.space.lockheed.com (Scott Claflin)
  891.     edelsohn@npac.syr.edu (David Edelsohn)
  892.     fireman@iuegtc.DNET.NASA.GOV (Gwyn Fireman)
  893.     gurman@umbra.gsfc.nasa.gov (Joseph B. Gurman)
  894.     jdlb@kukui.IFA.Hawaii.Edu (JF Pitot de La Beaujardiere)
  895.     kashyap@oddjob.uchicago.edu (Vinay Kashyap)
  896.     mayor@vaxine.larc.nasa.gov (Shane Mayor)
  897.     oet@maz.sma.ch (Thomas Oettli)
  898.     rmmoss@Texaco.COM (Robert M. Moss)
  899.     sterne@dublin.llnl.gov (Philip Sterne)
  900.     thompson@serts.gsfc.nasa.gov (William Thompson)
  901.     valenti@soleil.Berkeley.EDU (Jeff Valenti)
  902.     sterner@tesla.jhuapl.edu (Ray Sterner)
  903.     joel@stars.gsfc.nasa.gov (Joel Parker)
  904.         landers@tsunami.dseg.ti.com (David Landers)
  905.         dan@rsinc.com (Dan Carr)
  906.   
  907. --
  908. Mike Schienle                         Hughes Santa Barbara Research Center
  909. 8015@sbsun0010.sbrc.hac.com                   75 Coromar Drive, M/S B28/87
  910. Voice: (805)562-7466    Fax: (805)562-7881               Goleta, CA  93117
  911.  
  912.